{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# fibonacci Series ?\n",
    "\n",
    "\n",
    "#1 1 2 3 5 8 13 21 ...."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "1\n",
      "2\n",
      "3\n",
      "5\n",
      "8\n",
      "13\n",
      "21\n",
      "34\n",
      "55\n",
      "89\n"
     ]
    }
   ],
   "source": [
    "oldnumber = 0\n",
    "previousNumber = 1\n",
    "print('1')\n",
    "for i in range(0,10):\n",
    "    newNumber = previousNumber +oldnumber\n",
    "    oldnumber = previousNumber\n",
    "    previousNumber = newNumber\n",
    "    print(newNumber)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "def fibonacciSe(n):\n",
    "    oldnumber = 0\n",
    "    previousNumber = 1\n",
    "    print('1')\n",
    "    for i in range(0,n):\n",
    "        newNumber = previousNumber +oldnumber\n",
    "        oldnumber = previousNumber\n",
    "        previousNumber = newNumber\n",
    "        print(newNumber)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "1\n",
      "2\n",
      "3\n",
      "5\n",
      "8\n",
      "13\n",
      "21\n",
      "34\n",
      "55\n",
      "89\n"
     ]
    }
   ],
   "source": [
    "fibonacciSe(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decorator for the Function -- \n",
    "\n",
    "def inputDecoFun(argFun):\n",
    "    \n",
    "    def newFun():\n",
    "        num = int(input(\"Enter any Number - \"))\n",
    "        argFun(num)\n",
    "    return newFun\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "@inputDecoFun\n",
    "def fibonacciSe(n):\n",
    "    oldnumber = 0\n",
    "    previousNumber = 1\n",
    "    print('1')\n",
    "    for i in range(0,n):\n",
    "        newNumber = previousNumber +oldnumber\n",
    "        oldnumber = previousNumber\n",
    "        previousNumber = newNumber\n",
    "        print(newNumber)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enter any Number - 45\n",
      "1\n",
      "1\n",
      "2\n",
      "3\n",
      "5\n",
      "8\n",
      "13\n",
      "21\n",
      "34\n",
      "55\n",
      "89\n",
      "144\n",
      "233\n",
      "377\n",
      "610\n",
      "987\n",
      "1597\n",
      "2584\n",
      "4181\n",
      "6765\n",
      "10946\n",
      "17711\n",
      "28657\n",
      "46368\n",
      "75025\n",
      "121393\n",
      "196418\n",
      "317811\n",
      "514229\n",
      "832040\n",
      "1346269\n",
      "2178309\n",
      "3524578\n",
      "5702887\n",
      "9227465\n",
      "14930352\n",
      "24157817\n",
      "39088169\n",
      "63245986\n",
      "102334155\n",
      "165580141\n",
      "267914296\n",
      "433494437\n",
      "701408733\n",
      "1134903170\n",
      "1836311903\n"
     ]
    }
   ],
   "source": [
    "fibonacciSe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
